<template>
  <div class="book-comm">
    <div class="comm-comp">
      <c-comment-list :bookId="bookId" showType="all"/>
    </div>
    <div class="author">
      <c-author-show :authorName="book.authorName"/>
    </div>
  </div>
</template>

<script>
import cCommentList from '../../components/index/book/CommentList.vue';
import cAuthorShow from '../../components/index/book/AuthorShow.vue';

export default {
  components:{
    cCommentList, cAuthorShow
  },
  data(){
    return {
      bookId:this.$route.query.bookId,
      book:{}
    }
  },
  created(){
    this.getBookDetail();
  },
  methods:{
    getBookDetail(){
      this.$http.postForm('/pageJson/bookDetail', {bookId:this.bookId}, res => {
        this.book = res.book;
      });
    },
  }
}
</script>

<style lang='scss' scoped>
.book-comm {
  width: 80%;
  margin: 20px auto;
  .comm-comp {
    vertical-align: top;
    display: inline-block;
    margin-right: 20px;
    width: 70%;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
  }
  .author {
    display: inline-block;
    width: calc(30% - 100px);
  }
}
</style>